<template>
  <div>
    <el-form :model="ruleForm" status-icon label-width="100px" class="demo-ruleForm"
                 style="margin-top:30px;width: 30%;">
            <el-form-item label="ID" prop="pass">
                <el-input type="text" v-model="ruleForm.id"></el-input>
            </el-form-item>
            <el-form-item label="姓名" prop="checkPass">
                <el-input type="text" v-model="ruleForm.name"></el-input>
            </el-form-item>
            <el-form-item label="年龄" prop="age">
                <el-input type="text" v-model="ruleForm.age"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="warning" @click="submitForm('ruleForm')">修改</el-button>
            </el-form-item>
        </el-form>
  </div>
</template>

<script>
export default {
    name: "update",  
      data() {       
         return {       
            ruleForm: {    
                id: '',     
                name: '',      
                age: ''    
            }        
        };    
    },
    methods:{
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    alert('submit');
                }
            })
        }
    }
}
</script>

<style>

</style>